From: Keir Fraser Date: Thu, 4 Jun 2009 09:37:39 +0000 (+0100) Subject: xend: pass-through: report attach errors from device model X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13811 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=2cad22d41f621dc86401730d5dcec3191347054e;p=xen.git xend: pass-through: report attach errors from device model Cc: Masaki Kanno Cc: Edwin Zhai Signed-off-by: Simon Horman --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index b4e6e49cf5..b1befd7267 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -752,6 +752,12 @@ class XendDomainInfo: vslot = xstransact.Read("/local/domain/0/device-model/%i/parameter" % self.getDomid()) + try: + vslot_int = int(vslot, 16) + except ValueError: + raise VmError(("Cannot pass-through PCI function '%s'. " + + "Device model reported an error: %s") % + (bdf_str, vslot)) else: vslot = new_dev['vslot']